<?php 
//用户列表的启用和禁用和删除的修改
	include_once("./com.php");
	$uid=$_GET['uid'];
	$type=$_GET['type'];
	if($type==1){
	$sql="update user set utype=1 where uid=$uid";
	$res=mysql_query($sql);
	if(mysql_affected_rows()>0){;
		echo"<script>
			alert('已启用')
			location.href='user.php'
			</script>";
	}else{
		 echo"<script>
			alert('启用失败')
			location.href='user.php'
			</script>";
 	}
 }elseif($type==0){
 	$sql="update user set utype=0 where uid=$uid";
 	$fer=mysql_query($sql);
 	if(mysql_affected_rows()>0){
 		echo"<script>
			alert('禁用成功')
			location.href='user.php'
			</script>";
 	}else{
		 echo"<script>
			alert('禁用失败')
			location.href='user.php'
			</script>";
 	}
}elseif($type==3){
	$sql="delete from user where uid='$uid'";
	mysql_query($sql);
	if(mysql_affected_rows()>0){
		echo"<script>
			alert('删除成功')
			location.href='user.php'
			</script>";
	}
}
 ?>
